﻿@{
    Layout = "~/Views/Shared/_Layout.cshtml";
    ViewBag.Title = "Chefs";
}
<h2>@Mui.Chef</h2>
<fieldset><legend>@Mui.Search</legend>
<input type="text" id="search"/><button type="button" id="sb" class="awe-btn ibtn">@Mui.Search</button>
</fieldset>
<br/>
<button class="awe-btn" onclick="@(Url.Awe().PopupFormAction().Url(Url.Action("create")).Success("create").Height(300))">@Mui.Create</button>

@Html.Awe().AjaxForm().FormClass("frestore").Success("edit")
@Html.Awe().Confirm().Success("del")
@Html.Awe().AjaxList("Chefs").TableLayout(true).SearchButton("sb").Parent("search","search")
<script type="text/javascript">
    function del(o) {
        $('#chef' + o.Id).fadeOut(300, function () { $(this).remove(); });
    }
    function edit(o) {
        $('#chef' + o.Id).fadeOut(300, function () { $(this).after(o.Content).remove(); });
    }
    function create(o) {
        $('#Chefs').parent().find('tbody').prepend(o.Content);
    }
</script>

